import React, {useContext} from 'react'

import useCreateContext from './useCreateContext.js'

import AppReducerChild from './AppReducerChild'

export default function App() {
  const { ctx } = useCreateContext()
  const store = useContext(ctx)
  return (
    <div>
      {store.state.count}
      <button onClick={() => store.dispatch({type: 'add'})}>click</button>

      <AppReducerChild></AppReducerChild>
    </div>
  )
}

// export default () => {
//   return (
//     <AppReducer>
//       <App></App>
//     </AppReducer>
//   )
// }